package com.ruoyi.leave.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.leave.mapper.LeaveInfoMapper;
import com.ruoyi.leave.domain.LeaveInfo;
import com.ruoyi.leave.service.ILeaveInfoService;

/**
 * 出行信息Service业务层处理
 * 
 * @author rockvan
 * @date 2023-04-10
 */
@Service
public class LeaveInfoServiceImpl implements ILeaveInfoService 
{
    @Autowired
    private LeaveInfoMapper leaveInfoMapper;

    /**
     * 查询出行信息
     * 
     * @param id 出行信息主键
     * @return 出行信息
     */
    @Override
    public LeaveInfo selectLeaveInfoById(Long id)
    {
        return leaveInfoMapper.selectLeaveInfoById(id);
    }

    /**
     * 查询出行信息列表
     * 
     * @param leaveInfo 出行信息
     * @return 出行信息
     */
    @Override
    public List<LeaveInfo> selectLeaveInfoList(LeaveInfo leaveInfo)
    {
        return leaveInfoMapper.selectLeaveInfoList(leaveInfo);
    }

    /**
     * 新增出行信息
     * 
     * @param leaveInfo 出行信息
     * @return 结果
     */
    @Override
    public int insertLeaveInfo(LeaveInfo leaveInfo)
    {
        leaveInfo.setCreateTime(DateUtils.getNowDate());
        return leaveInfoMapper.insertLeaveInfo(leaveInfo);
    }

    /**
     * 修改出行信息
     * 
     * @param leaveInfo 出行信息
     * @return 结果
     */
    @Override
    public int updateLeaveInfo(LeaveInfo leaveInfo)
    {
        leaveInfo.setUpdateTime(DateUtils.getNowDate());
        return leaveInfoMapper.updateLeaveInfo(leaveInfo);
    }

    /**
     * 批量删除出行信息
     * 
     * @param ids 需要删除的出行信息主键
     * @return 结果
     */
    @Override
    public int deleteLeaveInfoByIds(Long[] ids)
    {
        return leaveInfoMapper.deleteLeaveInfoByIds(ids);
    }

    /**
     * 删除出行信息信息
     * 
     * @param id 出行信息主键
     * @return 结果
     */
    @Override
    public int deleteLeaveInfoById(Long id)
    {
        return leaveInfoMapper.deleteLeaveInfoById(id);
    }
}
